﻿<html>
<head>
<title>回单列表</title>
<link rel="stylesheet" href="/css/def.css">
<script src="/js/p.js"></script>
</head>

<body class="MyBody" scroll="yes">

<div style="overflow: auto; text-align: left; height: 35px; background-color: #C1FFE4;"></div>

<table cellpadding='0' cellspacing='0' class='Header3'>
<tr>
<td nowrap="nowrap" align="left" style="background-color:#fcfcfc;">
<div>&nbsp;日期：<input type="text" name="qryDate" id="qryDate" size="20" /> &nbsp;账号：<input type="text" name="qryAct" id="qryAct" size="20" /> &nbsp; &nbsp;<input type="button" name="query" value="查询" onclick="query()" /></div>
</td>
</tr>
</table>
<div id="divResultMsg" style="text-align: left; background-color: #C1FFE4;">
<table id="tabResultMsg" style="border: solid 0px #C1FFE4; text-align:left;color: #3E6373; display:none;">
<tr>
<td style="padding: 5px 0px 0px 10px;vertical-align: top;"></td>
<td style="padding-top:5px"><pre id="spanResultMsg" style=" font-size: 12px;"></pre></td>
</tr></table>
</div>

<div id="divList" style="padding-left:6px;"></div>

<div id="divHintMsg" style="position:absolute; top:0px; right:30px; z-index: 9901;background:#DDDDDD;filter:alpha(opacity=90);opacity:0.9; border: solid 1px #BCBCBC; display: none;"></div>

<script type="text/javascript">
var rColumn = {
"BUSDATE":"日期",
"OWNACT":"账号",
"RECEIPTNO":"回单编号",
"BUSREF":"业务参考号",
"REQBATCHNO":"支付批号",
"ASKNUMBER":"支付流水号",
"BANK":"银行代码",
"CUSTOMFILEID":"客制化文件标识",
"MONEYWAY":"交易方向",
"AMOUNT":"金额",
"RECEIPTFILE":"回单文件",
"SRCFILE":"源文件",
"CREATEDON":"创建日期"};

function initListTab(divId, tabId, columns){
	try {
		var html = "<table class=\"plist2\" id=\""+tabId+"\" width=\"90%\" align=\"center\"><tr>";
		for(var k in columns){
			html += "<td><nobr>" + columns[k] + "</nobr></td>";
		}
		html+="</tr></table>";
		document.getElementById(divId).innerHTML = html;
	}
    catch (err) {
        outputResultMsg("此页面存在一个错误。\n\n错误描述: " + err.description);
    }
}

function showListTab (tabId, columns) {
	try {
		var re = new RegExp("\\\\","g");
		var jsonTxt = eval('('+this.responseText.replace(re, "\\\\")+')');
		var respCode = jsonTxt["respCode"];
		var respInfo = jsonTxt["respInfo"];
		if("0" == respCode.toString()){
			var dataList = jsonTxt.dataList;
			for(var i=0; i<dataList.length; i++){
				var eachDataRow = dataList[i];
				var tmpRow = document.createElement("tr");
				tmpRow.id="tr"+eachDataRow["URID"];
				if(i%2 == 0){
					tmpRow.className = "tr2";
				}
				for(var k in columns){
					//alert(k);
					//alert(eachDataRow[k]);
		            var tmpCell = document.createElement("td");
		            
		            tmpCell.innerHTML = "<pre>"+eachDataRow[k]+"</pre>";
		            
		            tmpRow.appendChild(tmpCell);
		            //alert(eachDataRow[k]);
		        }
				document.getElementById(tabId).appendChild(tmpRow);
			}
		}else{
			outputResultMsg(respInfo);
		}
	}
    catch (err) {
    	var msg = "此页面存在一个错误。\r\n错误描述: " + err.description;
    	if (this.responseText !== undefined && this.responseText !== null && this.responseText !== ""){
    		msg+="\r\n响应内容："+this.responseText;
    	}
        outputResultMsg(msg);
    }
}

function replaceStr(pVal, pSrc, pTrg){
	var strLen = pVal.length;
	var idx = pVal.indexOf(pSrc);
	if(idx>=0){
		while(idx<strLen && idx>=0){
			var idx2 = loc.indexOf(pSrc, idx1+2);
		}
	}else{
		return pVal;
	}
}


function removeDataRow(tabId){//保留第一行
	var tab = document.getElementById(tabId);
	var rowLen = tab.rows.length;
	for(var i=rowLen-1;i>0;i--){
		tab.deleteRow(i);
	}
}

function query(){
	outputResultMsg("");
	removeDataRow("recptTab");
	var pData = "{\"qryDate\":\""+document.getElementById("qryDate").value+"\",\"qryAct\":\""+document.getElementById("qryAct").value+"\"}";
	postHttp("/receipt/receiptlist", pData, showListTab, "recptTab", rColumn);
}

function initPage(){
	initListTab("divList", "recptTab", rColumn);
	//var timeNow = new Date().format("yyyyMMdd");
	//document.getElementById("qryDate").value = timeNow;
}
initPage();
</script>
</body></html>

